Splitting functionality into appropriate files