Moved more code in objects