refactoring code out to other files
the rest of version 0.0.5