Minor firmware refactoring