Refactored stuff. Not working again