Code optimized

Just refactored..