Split functionality into multiple files to make maintenance easier