separated stuff into directives
removes extra code