Cleaned up module definitions and dependency injection