Split the implementations

Makes the code easy to work with.