Decomposition

Made code more readable