Rewrite to full OOP