Code cleanup, moved to modules where logically belongs
Code cleanup