Splitted things into separate files a bit.