Separated out all functionality and keys to independent files