Moved printing commands to methods