Cleaned code, class functions