Some refactoring, not some I like it though