Refactor code to be to github style, stuff is probably missing