refactors code into separate modules