Refactored stuff, renamed masks to be more descriptive of actual purpose, etc.