Refactored for more uniform file/directive/service structure.