Refactored some definitions