Refactored, made it slightly more easy to use