Clean up and reorganize some parts of the code

:+1: