refactored start/end