Minor refactoring: moved certain classes into new 'functional' folder.