Code cleanup as reccomended by 500lines reviewers.