reducing magic numbers + refactor