Bug fixes, abstraction