Lots of refactoring, added custom buckets