Is there a hierarchy to functional groups?

I think I am getting slightly confused about the names we give to functional groups. I am aware that there are different types of functional groups such as alkyl, aryl and acyl groups. 


I also know that there exist functional groups such as those of esters, ketones and amides which come under the acyl group. However, thinking about this recently I also realised that there existed a carbonyl group, which is also present in a ketone?


I am also a bit confused as to whether the acyl group's general formula is RCO or RCOX where X could be a variety of groups. Also, is R a part of the functional group or is it there to show what the functional group is attached to. 


Could someone please make this hierarchy of functional groups a bit clearer?




What you may be confusing is the difference between a functional group and a moiety. A moiety is a part of the molecule that could be either the whole functional group or just a part of the structure of a functional group.


[Wikipedia](http://en.wikipedia.org/wiki/Functional_group) does a decent job of explaining this.


![enter image description here](https://i.stack.imgur.com/o5cvU.jpg)


In this illustration there is an ester functional group and an acetyl moeity.


As for your second question about the [acyl group](http://en.wikipedia.org/wiki/Acyl), my understanding is that the formula is RCO- and that the X is not necessary to define the acyl group. The R represents an alkyl group.
![enter image description here](https://i.stack.imgur.com/e8VXr.jpg)


 4