Refactoring the code into one file

I think this will make it easier to depend on.