Moved code to its own package