split code into additional files

for maintainability & modularity purposes