Removed ugly function