Code refactor proposal

@novito this is my code refactor proposal. What do you think?