sashko does magic and refactors code