Moved code to implementation