simplification and goification of the code